#!/bin/bash
#This scripts is check for Mysql Slave status
counter=$(netstat -na|grep "LISTEN"|grep "3306"|wc -l)
if [ "${counter}" -eq 0 ]; then
    systemctl stop keepalived
    killall keepalived
    echo "step 1"
fi
echo "step 2"
ping 192.168.2.135 -w1 -c1 &>/dev/null 
if [ $? -ne 0 ]
then
    echo "step 3"
    systemctl stop keepalived
    killall keepalived
fi

echo "step 4"

